{% extends 'WebQuant/base.html' %}
{% block title %}云数据{% endblock %}
{% block content %}
<div style="overflow:hidden">
		<div class="left_data_bar">
				<a href="d1"><div class="list_one on">基础金融库</div></a>
					<div class="lists">
						<div class="list_two" onclick="$('.comments_box').slideToggle()">
							<span>基础数据</span>
						</div>
						<div class="list_box">
							<a href="t1"><div class="list_three"><span>交易日历表</span></div></a>
							<a href="t2"><div class="list_three"><span>交易所代码表</span></div></a>
							<a href="t3"><div class="list_three"><span>标准交易时段表</span></div></a>
						</div>

					</div>
					<div class="lists">
						<div class="list_two" onclick="$('.comments_box').slideToggle()">
							<span>公司数据</span>
						</div>
						<div class="list_box">
							<a href="t4"><div class="list_three"><span>公司基本信息表</span></div></a>
							<a href="t5"><div class="list_three"><span>机构名称变动表</span></div></a>
							<a href="t6"><div class="list_three"><span>董监事会成员任职表</span></div></a>
							<a href="t7"><div class="list_three"><span>董监高持股变动情况表</span></div></a>
							<a href="t8"><div class="list_three"><span>董监高持股薪酬明细表</span></div></a>
							<a href="t9"><div class="list_three"><span>公司股本结构变动表</span></div></a>
							<a href="t10"><div class="list_three"><span>公司限售股流通明细</span></div></a>
							<a href="t11"><div class="list_three"><span>公司前十大股东</span></div></a>
							<a href="t12"><div class="list_three"><span>公司前十大流通股东</span></div></a>
							<a href="t13"><div class="list_three"><span>公司股东户数表</span></div></a>
							<a href="t14"><div class="list_three"><span>公司股东交易所增持减持</span></div></a>
							<a href="t15"><div class="list_three"><span>公司股权激励信息表</span></div></a>
							<a href="t16"><div class="list_three"><span>公司首发信息表</span></div></a>
							<a href="t17"><div class="list_three"><span>公司首发发行结果表</span></div></a>
							<a href="t18"><div class="list_three"><span>上市公司分红信息表</span></div></a>
							<a href="t19"><div class="list_three"><span>公司公开增发计划新表</span></div></a>
							<a href="t20"><div class="list_three"><span>公司公开增发信息结果表</span></div></a>
							<a href="t21"><div class="list_three"><span>公司非公开增发信息表</span></div></a>
							<a href="t22"><div class="list_three"><span>公司配股预案新表</span></div></a>
							<a href="t23"><div class="list_three"><span>公司配股发行信息新表</span></div></a>
							<a href="t24"><div class="list_three"><span>公司业绩预告表</span></div></a>
							<a href="t25"><div class="list_three"><span>定期报告预约披露时间表</span></div></a>
							<div class="list_three"><span>资产负债表</span></div>
							<div class="list_three"><span>利润表</span></div>
							<div class="list_three"><span>现金流量表</span></div>
							<div class="list_three"><span>财务分析指标表</span></div>
							<div class="list_three"><span>公司主营业务构成按地区分布表</span></div>
							<div class="list_three"><span>公司主营业务构成按行业分布表</span></div>
							<div class="list_three"><span>公司主营业务构成按产品分布表</span></div>
							<div class="list_three"><span>公司重大事件主表</span></div>
							<div class="list_three"><span>公司重大事件进程子表</span></div>
						</div>

					</div>
					<div class="lists">
						<div class="list_two" onclick="$('.comments_box').slideToggle()">
							<span>股票数据</span>
						</div>
						<div class="list_box">
							<a href="data_base_frame.html"><div class="list_three on"><span>股票基本信息表</span></div></a>
							<div class="list_three"><span>港股基本信息表</span></div>
							<div class="list_three"><span>证券综合代码表</span></div>
							<div class="list_three"><span>证券停牌日历新表</span></div>
							<div class="list_three"><span>股票简称变动表</span></div>
						</div>

					</div>
					<div class="lists">
						<div class="list_two" onclick="$('.comments_box').slideToggle()">
							<span>基金数据</span>
						</div>
						<div class="list_box">
							<a href="data_base_frame.html"><div class="list_three on"><span>基金基本信息表</span></div></a>
							<div class="list_three"><span>公司基本信息表</span></div>
							<div class="list_three"><span>基金经理任职回报表</span></div>
							<div class="list_three"><span>基金前十持有人信息表</span></div>
							<div class="list_three"><span>基金份额变动表</span></div>
							<div class="list_three"><span>基金分红</span></div>
							<div class="list_three"><span>基金拆分折算表</span></div>
							<div class="list_three"><span>基金发行与上市表</span></div>
							<div class="list_three"><span>基金费率主表</span></div>
							<div class="list_three"><span>基金费率子表</span></div>
							<div class="list_three"><span>基金申赎转换限额表</span></div>
							<div class="list_three"><span>ETF申赎清单主表</span></div>
							<div class="list_three"><span>ETF申赎清单子表</span></div>
							<div class="list_three"><span>基金净值表</span></div>
							<div class="list_three"><span>货币式基金收益表</span></div>
							<div class="list_three"><span>基金净值表现比较表</span></div>
							<div class="list_three"><span>基金主要财务指标表</span></div>
							<div class="list_three"><span>基金资产负债表</span></div>
							<div class="list_three"><span>基金投资组合资产配置表</span></div>
							<div class="list_three"><span>基金投资组合股票投资配置表</span></div>
						</div>

					</div>

					<div class="list_two"><span>指数数据</span></div>
					<div class="lists">
						<div class="list_two" onclick="$('.comments_box').slideToggle()">
							<span>行业板块</span>
						</div>
						<div class="list_box">
							<a href="data_base_frame.html"><div class="list_three on"><span>公司最新从属行业表</span></div></a>
							<div class="list_three"><span>行业代码表</span></div>
							<div class="list_three"><span>公司最新从属行业表</span></div>
							<div class="list_three"><span>行业代码表</span></div>
						</div>

					</div>
					<div class="lists">
						<div class="list_two" onclick="$('.comments_box').slideToggle()">
							<span>行情数据</span>
						</div>
						<div class="list_box">
							<a href="data_base_frame.html"><div class="list_three on"><span>股票复权因子表</span></div></a>
							<div class="list_three"><span>基金复权因子表</span></div>
							<div class="list_three"><span>股票日行情表</span></div>
							<div class="list_three"><span>基金日行情表</span></div>
							<div class="list_three"><span>指数日行情表</span></div>
							<div class="list_three"><span>期货每日行情</span></div>
							<div class="list_three"><span>股票日行情估值表</span></div>
							<div class="list_three"><span>港股每日行情</span></div>
							<div class="list_three"><span>交易所超幅涨跌信息主表</span></div>
							<div class="list_three"><span>交易所超幅涨跌信息子表</span></div>
						</div>

					</div>
				<div class="list_one">对冲基金库</div>
					<div class="list_two"><span>基本信息</span></div>
				<div class="list_one">高频数据库</div>
					<div class="list_two"><span>股票数据</span></div>
					<div class="list_two"><span>基金高频</span></div>
					<div class="list_two"><span>债券高频</span></div>
					<div class="list_two"><span>指数高频</span></div>
				<a href="d2"><div class="list_one">事件驱动库</div></a>
					<div class="lists">
						<div class="list_two" onclick="$('.comments_box').slideToggle()">
							<span>传统事件驱动库</span>
						</div>
						<div class="list_box">
							<a href="data_base_frame.html"><div class="list_three on"><span>公司限售股流通明细</span></div></a>
							<div class="list_three"><span>董监高持股变动情况表</span></div>
							<div class="list_three"><span>公司股东交易所增持减持</span></div>
							<div class="list_three"><span>公司股权激励信息表</span></div>
							<div class="list_three"><span>上市公司分红信息表</span></div>
							<div class="list_three"><span>公司公开增发计划新表</span></div>
							<div class="list_three"><span>公司公开增发信息结果表</span></div>
							<div class="list_three"><span>公司非公开增发信息表</span></div>
							<div class="list_three"><span>公司配股预案新表</span></div>
							<div class="list_three"><span>公司配股发行信息新表</span></div>
							<div class="list_three"><span>公司业绩预告表</span></div>
							<div class="list_three"><span>公司重大事件主表</span></div>
							<div class="list_three"><span>公司重大事件进程子表</span></div>
						</div>

					</div>
				<div class="list_one">风险因子库</div>

		</div>
		<div style="overflow:hidden">
			<div class="right_data_cont">
				<div class="top_head">
					<h2>交易日基本信息表</h2>
					<p>主要收录自中国证券市场成立以来的所有上市交易品种的公开数据。</p>
					<span>免费</span>
				</div>
				<p class="data_name">参数说明</p>
				<table class="biao">
					<thead>
						<tr>
							<th>名称</th>
							<th>类型</th>
							<th>描述</th>
						</tr>
					</thead>
					<tbody id="arg"></tbody>
				</table>
				<p class="data_name">返回值说明</p>
				<table class="biao">
					<thead>
						<tr>
							<th>名称</th>
							<th>类型</th>
							<th>描述</th>
						</tr>
					</thead>
					<tbody id="reval"></tbody>
				</table>
				<table class="ku">
					<thead>
						<tr>
							<th>编号</th>
							<th>表名</th>
							<th>说明</th>
						</tr>
					</thead>
					<tbody class="dval">
					</tbody>
				</table>
				<a href="javascript:void(0)"></a>
			</div>
			<div class="page"><p></p></div>
		</div>
</div>
<script src="/static/WebQuant/js/mustache.min.js"></script>
<script src="/static/WebQuant/js/csrf.js"></script>
<script src="/static/WebQuant/js/page.js"></script>
<script src="/static/WebQuant/js/base.js"></script>
<script id="template" type="x-tmpl-mustache">
	[[#arg]]

	<tr>
		<td>[[name]]</td>
		<td>[[type]]</td>
		<td>[[description]]</td>
	</tr>
	[[/arg]]
</script>
<script id="template1" type="x-tmpl-mustache">
	[[#reval]]

	<tr>
		<td>[[name]]</td>
		<td>[[type]]</td>
		<td>[[description]]</td>
	</tr>
	[[/reval]]
</script>
<script id="template2" type="x-tmpl-mustache">
	[[#t]]

	<tr>
		<td>[[id]]</td>
		<td>[[name]]</td>
		<td>[[description]]</td>
	</tr>
	[[/t]]
</script>
<script>

	Mustache.tags = ['[[', ']]']
		$(".list_two").click(function(){
		$(this).siblings(".list_box").slideToggle();
	})


function getval(num){
	$(".data_name").show();
	$(".biao").show();
	$(".ku").hide();
	$(".page").hide();
	$(".top_head span").show();
	$.getJSON("/static/WebQuant/data/tableInOne.json", function(json){
		$(".right_data_cont .top_head h2").text(json[num].name);
		$(".right_data_cont .top_head p").text(json[num].des);
	    var template = $('#template').html();
	    var template1 = $('#template1').html();
    	Mustache.parse(template);
    	Mustache.parse(template1);
   	    var rendered = Mustache.render(template, json[num]);
  		$('#arg').html(rendered);
  		var rendered1 = Mustache.render(template1, json[num]);
  		$('#reval').html(rendered1);
  		$("tbody tr:nth-child(2n)").css("background", "#f0f6f9");
		$("tbody tr:last-child").css("border-bottom", "1px solid #ddd");
		$("th:nth-child(3)").css({"padding-left":"15px"});
		$("th:nth-child(2)").css({"width":"160px","padding-left":"15px"});
		$("th:nth-child(1)").css({"width":"160px","padding-left":"15px"});
	});
}

function getdval(num,pflag){
	$(".data_name").hide();
	$(".biao").hide();
	$(".ku").show();
	$(".page").show();
	$(".top_head span").hide();
	$.getJSON("/static/WebQuant/data/tableinfo.json", function(json){
		$(".right_data_cont .top_head h2").text(json[num].name);
		$(".right_data_cont .top_head p").text(json[num].des);
	    var template = $('#template2').html();
	    console.log(json[num]);
	    json[num].t = json[num].t.slice(15*(pflag-1),15*(pflag-1)+15)
	    console.log(json[num])
    	Mustache.parse(template);
   	    var rendered = Mustache.render(template, json[num]);

  		$('.dval').html(rendered);

  		$("tbody tr:nth-child(2n)").css("background", "#f0f6f9");
		$("tbody tr:last-child").css("border-bottom", "1px solid #ddd");
		$("th:nth-child(3)").css({"padding-left":"15px"});
		$("th:nth-child(2)").css({"width":"160px","padding-left":"15px"});
		$("th:nth-child(1)").css({"width":"160px","padding-left":"15px"});
	});
}

 $(".list_one").parent("a").click(function(e){
 	e.preventDefault();
 	var num = $(this).attr("href");
 	$(".left_data_bar div").removeClass("on");
	$(this).children("div").addClass("on");
	// if(num != "d1"){
		$.getJSON("/static/WebQuant/data/tableinfo.json", function(json){
			var pagenum = parseInt(json[num].t.length/15);
	   	    $(".page p").createPage({
		        pageCount:pagenum+1,
		        current:1,
		        backFn:function(p){
		             getdval(num,p);
		             console.log(p)
		        }
		    });
		})
	// }

 	getdval(num,1);
 })
$(".list_box a").click(function(e){
	e.preventDefault();

	var num = $(this).attr("href");
	console.log(num);
	$(".left_data_bar div").removeClass("on");
	$(this).children("div").addClass("on");
	getval(num);
})

$.getJSON("/static/WebQuant/data/tableinfo.json", function(json){
	getdval("d1",1);
	var pagenum = parseInt(json["d1"].t.length/15);
	$(".page p").createPage({
		pageCount:pagenum+1,
		current:1,
		backFn:function(p){
			 getdval("d1",p);
			 console.log(p)
		}
	});
})
$(".list_box").hide();

var isLog = {{log}}

if (isLog)
{
    $(".l_case2").css("display","block");
    $(".l_case1").css("display","none");
}
else
{
    $(".l_case2").css("display","none");
    $(".l_case1").css("display","block");
}
</script>
{% endblock %}